<li>
  <%= role.name %>
  [<% if @user.has_role?(role.name) %>
    <%= link_to 'remove role', 
                role_url(:id => role.id, :user_id => @user.id), 
                :method => :delete %>
  <% else %>
    <%= link_to 'assign role', 
                role_url(:id => role.id, :user_id => @user.id), 
                :method => :put %>
  <% end %>]
</li>
